package com.ssm.hxj.service.impl;

import com.ssm.hxj.page.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.hxj.search.tjscSearch;
import com.ssm.hxj.service.tjscService;
import com.ssm.hxj.view.tjscView;
import com.ssm.hxj.view.tjscviewview;
import com.ssm.mapper.MemberMapper;
import com.ssm.mapper.TjscMapper;
import com.ssm.pojo.Tjsc;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class tjscServicelmpl implements tjscService {

    @Resource
    private MemberMapper memberMapper;

    @Resource
    private TjscMapper tjscMapper;

    @Override
    public PageInfo<Tjsc> searchQuerytjscService(Page<Tjsc> page) throws Exception {
        PageHelper.startPage(page.getPageNum(),page.getPageSize());
        return new PageInfo<Tjsc>(this.tjscMapper.queryall(page.getSearchObj()));
    }

    @Override
    public int scokkkService(tjscviewview tjscviewview) {
        this.tjscMapper.inserttexamin(tjscviewview);
        this.tjscMapper.updatetjsc(tjscviewview.getZid());
        return 1;
    }
}
